import request from '@/utils/request'

export default {

  // 分页查询管理员列表
  getList(current, limit, searchObj) {
    return request({
      url: `/admin/findAdminList/${current}/${limit}`,
      method: 'post',
      data: searchObj
    })
  },
  // 根据id删除管理员
  deleteAdminInfo(id) {
    return request({
      url: `/admin/delete/${id}`,
      method: 'delete'
    })
  },
  // 批量删除
  batchRemoveHosp(idList) {
    return request({
      url: `/admin/batchRemove`,
      method: 'delete',
      data: idList
    })
  },
  // 解锁与锁定
  lockAdmin(id, status) {
    return request({
      url: `/admin/lockAdmin/${id}/${status}`,
      method: 'put'
    })
  },

  // 根据id查询管理员
  getAdminInfo(id) {
    return request({
      url: `admin/getAdminInfo/${id}`,
      method: 'get',
      data: id
    })
  },
  // 根据用户名查询管理员
  verUsername(username) {
    return request({
      url: `admin/verUsername/${username}`,
      method: 'get',
    })
  },
  // 修改管理员
  updateAdminInfo(adminId, username, password, licence42Code, adminName, accountType) {
    return request({
      url: `/admin/updateAdminInfo`,
      method: 'post',
      data: {
        adminId: adminId,
        username: username,
        password: password,
        licence42Code: licence42Code,
        adminName: adminName,
        accountType: accountType,
      }
    })
  },

  // 获取当前操作人权限
  getAuth() {
    return request({
      url: `/admin/getAuth`,
      method: 'get',
    })
  },

  getName() {
    return request({
      url: `/admin/getName`,
      method: 'get',
    })
  }

}
